// This page provides functionality to delete/edit the hospitals
// Created on : may 06,06
// Author : Rupinder Saini

using System;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.WebControls;
using SiteManager;

public partial class Admin_Ad_ManagelatestHospitals : Page
{
    // creating an instance of manager class
    private readonly Manager mgr = new Manager(true, "ConnectionString");

    protected void Page_Load(object sender, EventArgs e)
    {
        lblMsg.Text = "";
        if (!Page.IsPostBack)
        {
            grdmedsch.Visible = true;
            BindGridView();
           
        }
       
    }

   

    //paging
    protected void grdmedsch_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        grdmedsch.PageIndex = e.NewPageIndex;
        BindGridView();
    }

    // delete confirmation
    protected void grdmedsch_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        //---------------------------------------------------------------
        //if (e.Row.RowType == DataControlRowType.Header)
        //{
        //    var chkBox = (CheckBox) e.Row.FindControl("HeaderLevelCheckBox");
        //    chkBox.Attributes.Add("onclick", "ChangeAllCheckBoxStates(this.checked);");
        //}

        //---------------------------------------------------------------
    }


    #region general functions

    /// <summary>
    ///     binds the grid view
    /// </summary>
    public void BindGridView()
    {
        try
        {
            var sqlParam = new SqlParameter[1];
            sqlParam[0] = new SqlParameter("@type", Request.QueryString["type"].ToString().Trim());
            DataSet ds = CustomRepository.CustumDataSetFunction("USP_GET_ADMIN_SEO_DATA", sqlParam);


            if (ds.Tables[0].Rows.Count > 0)
            {
                grdmedsch.DataSource = ds;
                //grdmedsch.PageSize = Convert.ToInt32(Session["AdminPageSize"].ToString());
                grdmedsch.DataBind();
              
                //added by ranjeet at 29/02/2008
                //        TotalSearchHospital();
            }
            else
            {
                lblMsg.Text =
                    "No Records found!!<br>";
                lblMsg.ForeColor = Color.Red;
                grdmedsch.Visible = false;
                lblMsg.Visible = true;
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }

    #endregion
}